package com.example.springboot_system.service;


import com.example.springboot_system.pojo.Role;
import com.example.springboot_system.pojo.User;
import com.example.springboot_system.pojo.vo.ApplyRspVO;
import com.example.springboot_system.utils.ResponseResult;
import com.sun.net.httpserver.HttpsConfigurator;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.net.UnknownHostException;

public interface UserService {
    //登录
    ResponseResult doLogin(String email, String plainPassword, HttpSession session,HttpServletRequest request) throws UnknownHostException;
    //电话号码登录
    ResponseResult doLoginByPhone(String phone, String code, HttpSession session);

    //注册
    ResponseResult doRegister(User user, String code,String description, HttpSession session);
    //个人信息
    User findUserInfoByUserId(String id);
    //更新个人信息
    ResponseResult updateUserInfo(User user );
    //检查原密码正确性
    ResponseResult checkPwd(String oldPassword,HttpSession session );
    //更改密码
    ResponseResult updatePassword(String oldPassword,String newPassword,String okPassword,HttpSession session);
    //查询用户的所有角色
    ResponseResult findUserRole(HttpSession session);
    //给用户添加角色身份
    ResponseResult addUserRole(String description,HttpSession session);
    //查询代审核的角色
    String getRoleApply(HttpSession session);
    //通过审核 将email_state设置为1
    ResponseResult Approved(String  username,HttpSession session);
    //通过审核 将email_state设置为-1
    ResponseResult NoApproved(String  username,HttpSession session);
    //检查邮箱是否存在
    ResponseResult checkEmail(String email);
    //检查用户名是否存在
    ResponseResult checkUsername(String username);

    //判断手机是否正确
    ResponseResult checkPhone(String phone,HttpSession session);
    //查询登录信息
    ResponseResult findUserLoginInfo(HttpSession session,@RequestParam(defaultValue = "1",value = "pageNum") Integer pageNum);
}
